﻿using Einstein.Utility;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace Einstein.UnitTest
{
    
    
    /// <summary>
    ///这是 RealTimeBoardAPITest 的测试类，旨在
    ///包含所有 RealTimeBoardAPITest 单元测试
    ///</summary>
    [TestClass()]
    public class RealTimeBoardAPITest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///RealTimeBoardAPI 构造函数 的测试
        ///</summary>
        [TestMethod()]
        public void RealTimeBoardAPIConstructorTest()
        {
            RealTimeBoardAPI target = new RealTimeBoardAPI();
            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }

        /// <summary>
        ///BindPort 的测试
        ///</summary>
        [TestMethod()]
        public void BindPortTest()
        {
            StringBuilder szServer = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.BindPort(szServer, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///CloseChannel 的测试
        ///</summary>
        [TestMethod()]
        public void CloseChannelTest()
        {
            byte aChannel = 0; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.CloseChannel(aChannel, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///CloseNet 的测试
        ///</summary>
        [TestMethod()]
        public void CloseNetTest()
        {
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.CloseNet();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///JX102R_Read_EquNo 的测试
        ///</summary>
        [TestMethod()]
        public void JX102R_Read_EquNoTest()
        {
            T_NetIP aNetIP = new T_NetIP(); // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.ReadEquNo(ref aNetIP, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///OpenChannel 的测试
        ///</summary>
        [TestMethod()]
        public void OpenChannelTest()
        {
            byte aChannel = 0; // TODO: 初始化为适当的值
            bool aManualClose = false; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.OpenChannel(aChannel, aManualClose, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///OpenNet 的测试
        ///</summary>
        [TestMethod()]
        public void OpenNetTest()
        {
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.OpenNet();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///ReadCard 的测试
        ///</summary>
        [TestMethod()]
        public void ReadCardTest()
        {
            int readerNO = 0; // TODO: 初始化为适当的值
            int readerNOExpected = 0; // TODO: 初始化为适当的值
            StringBuilder cardNO = null; // TODO: 初始化为适当的值
            StringBuilder clientIP = null; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.ReadCard(ref readerNO, cardNO, clientIP);
            Assert.AreEqual(readerNOExpected, readerNO);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///ReadTime 的测试
        ///</summary>
        [TestMethod()]
        public void ReadTimeTest()
        {
            StringBuilder aTime = null; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.ReadTime(aTime, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///ReadVer 的测试
        ///</summary>
        [TestMethod()]
        public void ReadVerTest()
        {
            StringBuilder verSerial = null; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.ReadVer(verSerial, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///RespondCard 的测试
        ///</summary>
        [TestMethod()]
        public void RespondCardTest()
        {
            int readNO = 0; // TODO: 初始化为适当的值
            int typeID = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.RespondCard(readNO, typeID);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///RespondLedCard 的测试
        ///</summary>
        [TestMethod()]
        public void RespondLedCardTest()
        {
            int readNO = 0; // TODO: 初始化为适当的值
            int typeID = 0; // TODO: 初始化为适当的值
            StringBuilder ledMsg = null; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.RespondLedCard(readNO, typeID, ledMsg);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///RespondSoundCard 的测试
        ///</summary>
        [TestMethod()]
        public void RespondSoundCardTest()
        {
            int readNO = 0; // TODO: 初始化为适当的值
            int sndMsgLen = 0; // TODO: 初始化为适当的值
            int typeID = 0; // TODO: 初始化为适当的值
            StringBuilder sndMsg = null; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.RespondSoundCard(readNO, sndMsgLen, typeID, sndMsg);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetAddress 的测试
        ///</summary>
        [TestMethod()]
        public void SetAddressTest()
        {
            T_NetIP aNetIP = new T_NetIP(); // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            RealTimeBoardAPI.SetAddress(aNetIP, ip, port);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }

        /// <summary>
        ///SetCDMsg 的测试
        ///</summary>
        [TestMethod()]
        public void SetCDMsgTest()
        {
            byte typeID = 0; // TODO: 初始化为适当的值
            StringBuilder msg = null; // TODO: 初始化为适当的值
            byte len = 0; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetCDMsg(typeID, msg, len, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetCodeEndChar 的测试
        ///</summary>
        [TestMethod()]
        public void SetCodeEndCharTest()
        {
            int len = 0; // TODO: 初始化为适当的值
            int end1 = 0; // TODO: 初始化为适当的值
            int end2 = 0; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetCodeEndChar(len, end1, end2, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetDelayValue 的测试
        ///</summary>
        [TestMethod()]
        public void SetDelayValueTest()
        {
            byte delay1 = 0; // TODO: 初始化为适当的值
            byte delay2 = 0; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetDelayValue(delay1, delay2, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetServer 的测试
        ///</summary>
        [TestMethod()]
        public void SetServerTest()
        {
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetServer(ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetTime 的测试
        ///</summary>
        [TestMethod()]
        public void SetTimeTest()
        {
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetTime(ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetTimeOut 的测试
        ///</summary>
        [TestMethod()]
        public void SetTimeOutTest()
        {
            int aDelay = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetTimeOut(aDelay);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetUARTBaud 的测试
        ///</summary>
        [TestMethod()]
        public void SetUARTBaudTest()
        {
            int baud1 = 0; // TODO: 初始化为适当的值
            int baud2 = 0; // TODO: 初始化为适当的值
            StringBuilder ip = null; // TODO: 初始化为适当的值
            int port = 0; // TODO: 初始化为适当的值
            int expected = 0; // TODO: 初始化为适当的值
            int actual;
            actual = RealTimeBoardAPI.SetUARTBaud(baud1, baud2, ip, port);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
    }
}
